package com.lzx.iteam.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.lzx.iteam.R;

import java.util.ArrayList;

/**
 * Created by zhangshuai on 15-4-23.
 */
public class ContactGroupAdapter extends BaseAdapter {

    private Context mContext;
    private ArrayList<String> mDatas;

    public ContactGroupAdapter(Context mContext,ArrayList<String> mDatas){
        this.mContext = mContext;
        this.mDatas = mDatas;
    }

    @Override
    public int getCount() {
        return mDatas.size();
    }

    @Override
    public Object getItem(int i) {
        return mDatas.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {

        if (view == null){
           view = LayoutInflater.from(mContext).inflate(R.layout.contact_group_item,viewGroup,false);
        }
        TextView text = (TextView) view.findViewById(R.id.contact_tags_tv);
        text.setText(mDatas.get(i));
        return view;
    }
}
